package com.peppa.petshop.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.peppa.petshop.entity.Customer;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 张三
 * @since 2021-06-02
 */
@Mapper
public interface CustomerMapper extends BaseMapper<Customer> {
    @Select("select * from pet_shop.customer")
    IPage<Customer> selectAll(IPage<Customer> page);

    @Update("update customer set deleted = 0 where customer_id = #{id}")
    void unlocked(@Param("id") Integer id);
}
